/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.UnsupportedEncodingException;

/**
 * <p>Project: javaseapp - Str1
 * <p>Powered by webrx On 2021-08-06 10:36:52
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Str5 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String n = null;
        //技巧：如果判断一个变量和字符串常量的内容值是不是一样，尽量用字符串常量的equals()和变量比较
        //这样最大好处是代码强壮，可以有效解决空指针异常
        if ("admin".equalsIgnoreCase(n)) {
            System.out.println("欢迎：" + n);
        }

        System.out.println("Hello Java".toLowerCase());
        System.out.println("Hello Java".toUpperCase());

        System.out.println("            java         hello           ");
        System.out.println("            java         hello           ".length());
        System.out.println("            java         hello           ".trim());
        System.out.println("            java         hello           ".replace(" ", ""));
        System.out.println("            java         hello           ".trim().length());
    }
}
